﻿@using StackExchange.Opserver.Data.Redis
@model StackExchange.Opserver.Views.Redis.DashboardModel
@{
    var infos = RedisInstance.GetInstances(Model.CurrentRedisServer);
}
<style>
    .redis-infos-wrap { float: left;position: relative;left: 50%;}
    .redis-info-list { float: left;position: relative;left: -50%;}
</style>
<div class="bottom-sub-section">
    <div class="node-summary redis-summary redis-infos-wrap">
        @if (infos.Any())
        {
            <div class="redis-info-list">
                @foreach (var info in infos)
                {
                    <div class="redis-node-info">
                        <div class="server-name">
                            @if (info.Name.HasValue())
                            {
                                @:<span title="Redis server on @info.Host:@info.Port (@info.Name)">@info.Name <b>:@info.Port</b></span>
                            }
                            else
                            {
                                @:Redis Info for @(info.Host)<b>:@info.Port</b>
                            }
                            <span class="last-updated">
                                @info.Info.ToPollSpan()
                            </span>
                        </div>
                        @Html.Partial("~/Views/Redis/Server.Info.cshtml", info)
                        @Html.Partial("~/Views/Redis/Server.Clients.cshtml", info)
                    </div>
                }
            </div>
        }
    </div>
</div>